package com.my.aslife.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my.aslife.module.entity.Demand;
import com.my.aslife.module.entity.bo.DemandUpdateBo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2022-12-12
 */
public interface DemandMapper extends BaseMapper<Demand> {


    /**
     * @param status 状态
     * @param handlerId 处理人id
     * @param addressKey 雪花算法key
     */
    void checkDemandContext(@Param("status") Integer status,
                            @Param("handlerId") Long handlerId, @Param("addressKey") Long addressKey,
                            @Param("illegal") String illegal);

    void updateAddress(@Param("demandUpdateBo")DemandUpdateBo demandUpdateBo, @Param("updateTime")Date updateTime);

    void deleteDemandByAddressKey(String addressKey);

    void setDemandStatusIsAccepted(Long demandKey);

    List<Demand> getPassDemandList(Long uid);

    List<Demand> queryDemandInfoByAddressKeys(Set<String> range);

    void updateOrderStatusIsFinish(@Param("url") String url, @Param("orderId") Long orderId);

    List<Demand> getAllDemandInfo(int current, int pageSize);

    void runOk(Demand demand);
}
